﻿using System;
using System.Data;
using System.Collections.Generic;
using Maticsoft.Common;

namespace BLL.Procurement
{
    public class T_PUB_PURCHASEMATERIAL
    {
        private readonly DALL.Procurement.T_PUB_PURCHASEMATERIAL dal = new DALL.Procurement.T_PUB_PURCHASEMATERIAL();
        public T_PUB_PURCHASEMATERIAL()
        { }

        public void AddPurchase(Model.Procurement.T_PUB_PURCHASE model, IList<Model.Procurement.T_PUB_PURCHASEMATERIAL> addList)
        {
            dal.AddPurchase(model, addList);
        }

        public void EditPurchase(Model.Procurement.T_PUB_PURCHASE model, IList<Model.Procurement.T_PUB_PURCHASEMATERIAL> addList, IList<Model.Procurement.T_PUB_PURCHASEMATERIAL> editList)
        {
            dal.EditPurchase(model, addList, editList);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetListByPid(string strPID)
        {
            string strWhere = string.Format(" PURCHASE_ID='{0}'", strPID);
            return dal.GetList(strWhere);
        }

        #region  Method
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.Procurement.T_PUB_PURCHASEMATERIAL model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.Procurement.T_PUB_PURCHASEMATERIAL model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int ID)
        {

            return dal.Delete(ID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.Procurement.T_PUB_PURCHASEMATERIAL GetModel(int ID)
        {

            return dal.GetModel(ID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.Procurement.T_PUB_PURCHASEMATERIAL> GetModelList(string strWhere)
        {
            return dal.GetListArray(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }
        #endregion
    }
}
